package com.app.brilliant.game.service;

import com.app.brilliant.common.api.ApiResult;
import com.app.brilliant.common.service.BaseService;
import com.app.brilliant.common.vo.PageContainer;
import com.app.brilliant.game.bean.WxUser;
import com.app.brilliant.game.param.WxLoginParam;
import com.app.brilliant.game.response.WxUserListInfo;
import com.app.brilliant.sys.params.WxUserListPageParam;

import java.util.Map;

/**
 * @author GF
 * @description 针对表【wx_user】的数据库操作Service
 * @createDate 2025-07-25 10:21:53
 */
public interface WxUserService extends BaseService<WxUser> {
    ApiResult loginWx(WxLoginParam wxLoginParam);

    PageContainer<WxUserListInfo> wxUserList(WxUserListPageParam wxUserListPageParam);

    boolean changeAppUserState(Integer uid, Integer state);

    /**
     * 根据openId获取用户信息
     * 
     * @param openId 微信openId
     * @return 用户信息
     */
    WxUser getByOpenId(String openId);

    /**
     * 检查邮箱是否已注册
     * 
     * @param email 邮箱地址
     * @return 是否已注册
     */
    boolean existsByEmail(String email);

    /**
     * 通过邮箱重置密码
     * 
     * @param email 邮箱地址
     * @param newPassword 新密码
     * @param verificationCode 验证码
     * @return 是否重置成功
     */
    boolean resetPasswordByEmail(String email, String newPassword, String verificationCode);

    boolean registerWxUserByEmail(String email, String password);

    Map<String, Object> loginByEmail(String email, String password);
}